package com.navinfo.data.esper.cep.linkid;

import com.espertech.esper.client.EventBean;
import com.espertech.esper.client.UpdateListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;

public class LinkidPatternListenerThread implements UpdateListener {
//    public EventBean getLastEvent() {
//        return lastEvent;
//    }

    public List<EventBean> getEventlist() {
        return eventlist;
    }

    //    private EventBean lastEvent;
    private List<EventBean> eventlist=new ArrayList<EventBean>();

    public void update(EventBean[] newEvents, EventBean[] oldEvents) {

        if (newEvents != null) {
            EventBean event = newEvents[0];
            eventlist.add(newEvents[0]);
        }
    }

    private static final Logger log = LoggerFactory.getLogger(LinkidPatternListenerThread.class);
}
